﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CRMWeb.Utilities;
using CRMWeb.Utilities.Context;
using System.Web.Services;
using CRMBiz;
using CRMEntity;

namespace CRMWeb.Pages
{
    public partial class SendDual : CRMWeb.Utilities.BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            hdnDualOpr.Value = CMSContext.CurrentUser.MemberName;
            hdnNodeValInPage.Value = CMSContext.CurrentUser.NodeID.ToString();
        }

        [WebMethod()]
        public static void saveNewHistory(string HistoryType, int contactid, string hdate, string htime, string action, string user, string description, int appid)
        {
            HistoryInfo historydata = new HistoryInfo();

            historydata.historyDate = hdate;
            historydata.historyTime = htime;
            historydata.action = action;
            historydata.oprator = user;
            historydata.description = description;

            if (HistoryType == "Contact")
            {
                historydata.contactID = contactid;
                historydata.appID = 0;
                HistoryHandler.AddHistory(historydata);
            }
            else if (HistoryType == "Application")
            {
                historydata.contactID = 0;
                historydata.appID = appid;
                HistoryHandler.AddHistory(historydata);
            }

        }

    }
}